{include file="news/header.tpl"}



<!-- start: Content -->
<div id="content" class="">


<div class="row-fluid">


<div class="box span12"><!-- Default panel contents -->



<div class="box-content">
 {include file="order/top.tpl"}

<form name="news" action="/order/export/" method="post"
	class="form-inline">
	<span class="icon-eye-open">实时监控</span>：{if $coupons.status!="ok"}<span class="label label-important">警告</span>[{if $coupons.status>0}总余额少了{else}总余额多了{/if}{$coupons.status}]{else}<span class="label label-success">安全</span>{/if} 


 |   注：统计上一次结算的积分id   公式:用户余额=(期初余额+期初未确认+本期收入)-本期支出-本期未确认
</form>
  
<table class="table  table-hover">
	<tr>


		<th  >日期</th>
		<th>总余额</th>
		<th>收入</th>
		<th>支出</th>
		<th>未确认</th>
		
		<th>截至积分流水号</th>

	</tr>
    
    <tr>
		<td ><button type="button" onclick="audit()" class="btn btn-sm"><span
	class="icon-shopping-cart"> 结算</span></button></td>
		<td><input type="text" class="input-small" disabled id="balance" value="{$coupons.balance}"></td>
		<td><input type="text" class="input-small" disabled  id="income" value="{$coupons.income}"></td>
		<td><input type="text" class="input-small" disabled  id="spend" value="{$coupons.spend}"></td>
		<td><input type="text" class="input-small" disabled  id="unconfirmed" value="{$coupons.unconfirmed}"></td>
		<td><input type="text" class="input-small"    id="coupon_no" value="{$coupons.coupon_no}"></td>
	</tr>

	{foreach from=$audit item=l }
	<tr>







		<td>{$l.add_time|date_format:"%m/%d"}</td>
		<td>{$l.balance}</td>
		<td>{$l.income}</td>
		<td>{$l.spend}</td>
		<td>{$l.unconfirmed}</td>
		
		<td>{$l.coupon_no}</td>

		
	</tr>
	{/foreach}

</table>


<div class="pagination pagination-centered">
<ul id="pager"></ul>
</div>

</div>




</div>


{literal} <script type='text/javascript'>

	function audit(){
    var balance=$("#balance").val();
    var spend=$("#spend").val();
    var income=$("#income").val();
    var unconfirmed=$("#unconfirmed").val();
    var couponid=$("#coupon_no").val();

	$.post("./index.php?coupons/setaudit",{balance:balance,spend:spend,income:income,unconfirmed:unconfirmed,coupon_no:couponid},function(data){
       alert(data.message);
       location.reload();
   },"json")
	}




</script> {/literal} {include file="news/footer.tpl"}